package router

import (
	"jgt-oper/src/web"

	"github.com/facebookgo/inject"
	"github.com/teambition/gear"
	"jgt-oper/src/context"
)

// WebRCMap 公共资源分类管理相关路由
func WebRCMap(g *inject.Graph, r *gear.Router) {
	a := new(web.RCController)
	err := g.Provide(&inject.Object{Value: a})
	if err != nil {
		panic(err)
	}

	r.Get("/resource-classification/page", context.WrapContext(a.QueryPage))
	r.Get("/resource-classification/:id", context.WrapContext(a.Get))
	r.Post("/resource-classification", context.WrapContext(a.Create))
	r.Put("/resource-classification/:id", context.WrapContext(a.Update))
	r.Delete("/resource-classification/:id", context.WrapContext(a.Delete))
}
